const initDate={
    num:0,
    data:[]
}

export default (state=initDate,actions)=>{
    switch (actions.type) {
        case 'XUAN':
            return{
                ...state,
                num:state.num+1
            }
        case 'RESTNUM':
            return{
                ...state,
                num:state.num<1?0:state.num-1
            }
        case 'CHUAN':
            return{
                ...state,
                num:actions.num
            }
        case 'GETJSON':
            return{
                ...state,
                data:actions.payload
            }
        default:
            return state
    }
}

//在这里写入所需要使用的数据